/**
@author		Jong Min, Lee
@date		  02/11/2014
@brief		frame class and producer class

copyright(c) Tae Young Soft. All right reserved. 2014
*/
#include "stdafx.h"
#include "Taurus_DcmData/Frame.h"

#include "Taurus_DcmData/DcmFrame.h"
#include "Taurus_DcmData/Instance.h"

CFrame::CFrame()
{
  init();
}

CFrame::~CFrame()
{
  destroy();
}

void CFrame::init()
{
  m_theDcmFrame = NULL;
  m_theParent = NULL;
}

void CFrame::destroy()
{
}

DWORD CFrameProducer::produce(CDcmFrame* dcmFrame, CInstance* parent, CFrame*& outFrame)
{
  if(dcmFrame == NULL) return ERROR_INVALID_PARAMETER;

  CFrame* newFrame = NULL;
  _TRY_ALLOC(newFrame, CFrame)
  if(newFrame == NULL) return ERROR_NOT_ENOUGH_MEMORY;

  //set parent
  newFrame->m_theParent = parent;
  //set dicom frame
  newFrame->m_theDcmFrame = dcmFrame;

  outFrame = newFrame;

  return ERROR_SUCCESS;
}
